drm/nouveau: Fix drm poll_helper handling
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Mon, 15 May 2017 09:04:31 +0000 (12:04 +0300)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 23 Jul 2017 02:58:40 +0000 (02:58 +0000)
commit3015b6634344b518aa4f00f947365de341931da2
tree6b6f2b1b080a769bec57bf04e404b597e183a0ae
parenta845dc0d781663b59e0be8c79656cb876757e28b
drm/nouveau: Fix drm poll_helper handling

[ Upstream commit 9a2eba337cacefc95b97c2726e3efdd435b3460e ]

Commit cae9ff036eea effectively disabled the drm poll_helper by checking
the wrong flag to see if the driver should enable the poll or not:
mode_config.poll_enabled is only set to true by poll_init and it is not
indicating if the poll is enabled or not.
nouveau_display_create() will initialize the poll and going to disable it
right away. After poll_init() the mode_config.poll_enabled will be true,
but the poll itself is disabled.

To avoid the race caused by calling the poll_enable() from different paths,
this patch will enable the poll from one place, in the
nouveau_display_hpd_work().

In case the pm_runtime is disabled we will enable the poll in
nouveau_drm_load() once.

Fixes: cae9ff036eea ("drm/nouveau: Don't enabling polling twice on runtime resume")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Lyude <lyude@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/nouveau/nouveau_drm.c